home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.3 Development Libraries / SGI IRIX 6.3 Development Libraries.iso / dist6.3 / ViewKit_dev.idb / usr / include / Vk / VkResizer.h.z / VkResizer.h
Encoding:
C/C++ Source or Header  |  1996-09-20  |  3.4 KB  |  92 lines

  1. ////////////////////////////////////////////////////////////////////////////////
  2. ///////   Copyright 1992, Silicon Graphics, Inc.  All Rights Reserved.   ///////
  3. //                                                                            //
  4. // This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;     //
  5. // the contents of this file may not be disclosed to third parties, copied    //
  6. // or duplicated in any form, in whole or in part, without the prior written  //
  7. // permission of Silicon Graphics, Inc.                                       //
  8. //                                                                            //
  9. // RESTRICTED RIGHTS LEGEND:                                                  //
  10. // Use,duplication or disclosure by the Government is subject to restrictions //
  11. // as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data     //
  12. // and Computer Software clause at DFARS 252.227-7013, and/or in similar or   //
  13. // successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -    //
  14. // rights reserved under the Copyright Laws of the United States.             //
  15. //                                                                            //
  16. ////////////////////////////////////////////////////////////////////////////////
  17. #ifndef _VK_RESIZER_
  18. #define _VK_RESIZER_
  19.  
  20. #include <Vk/VkComponent.h>
  21.  
  22. enum VkResizerReason { VR_none, VR_resizing, VR_moving, VR_resized,
  23.                    VR_moved };
  24.  
  25. class VkResizer : public VkComponent {
  26.  
  27.   public:
  28.  
  29.     VkResizer(Boolean autoAdjust = False, Boolean liveResize = False);
  30.     virtual ~VkResizer();
  31.  
  32.     static const char *const stateChangedCallback;
  33.  
  34.     void setIncrements(int resizeWidth, int resizeHeight,
  35.                  int moveX, int moveY);
  36.  
  37.     Boolean shown() { return _shown; }
  38.  
  39.     void attach(Widget w);
  40.     void detach();
  41.  
  42.     void show();
  43.     void hide();
  44.  
  45.     void adjustGeometry();
  46.  
  47.     void lastLocation(Position *x_return, Position *y_return,
  48.               Dimension *width_return, Dimension *height_return);
  49.  
  50.   protected:
  51.  
  52.     void setupCallbacks(Widget w);
  53.     void removeCallbacks(Widget w);
  54.     void rebuild(Widget w);
  55.     void defineCursors();
  56.     void buttonPress(Widget grip, XEvent *event);
  57.     void buttonRelease(Widget grip, XEvent *event);
  58.     void pointerMotion(XEvent *event);
  59.     void resizeFrame(int x, int y);
  60.     void moveFrame(int x, int y);
  61.     void matchFrame();
  62.     Boolean allowResize() { return (_resizeWidth || _resizeHeight); }
  63.     Boolean allowMove() { return (_moveX || _moveY); }
  64.  
  65.     Widget _parent, _adjuster;
  66.     Widget _frame, _area, _llGrip, _urGrip, _grab, _grabGrip;
  67.     Boolean _autoAdjust, _liveResize, _shown;
  68.     Boolean _resizeWidth, _resizeHeight, _moveX, _moveY;
  69.     int _gripSize, _gripThickness, _frameThickness, _frameSpacing;
  70.     int _frameOverhead;
  71.     Display *_dpy;
  72.     Pixel _bg, _fg;
  73.     Cursor _llCursor, _urCursor, _moveCursor;
  74.     int _grabButton, _grabX, _grabY, _originX, _originY, _sizeX, _sizeY;
  75.     Position _startX, _startY;
  76.     Dimension _startWidth, _startHeight;
  77.     Boolean _pendingRebuild;
  78.  
  79.   private:
  80.     
  81.     static void reconfig_stub(Widget w, XtPointer client_data, XEvent *event,
  82.                 Boolean *dispatch);
  83.     static void button_press(Widget w, XtPointer client_data, XEvent *ev,
  84.                Boolean *dispatch);
  85.     static void button_release(Widget w, XtPointer client_data, XEvent *ev,
  86.                    Boolean *dispatch);
  87.     static void pointer_motion(Widget w, XtPointer client_data, XEvent *ev,
  88.                  Boolean *dispatch);
  89. };
  90.  
  91. #endif
  92.